<table width="100%" border="0" cellspacing="0" cellpadding="20">
	<tr>
	    <td class="tahoma11G">
			<ul id="menu" class="menu">
				<?php
					$Qcategory= "SELECT *  from category order by name";
					$Ccategory = $db->sql_total($Qcategory);
					$Rcategory = $db->sql_fetch($Qcategory);
					
					foreach($Rcategory as $row){
						?>
						<li>
							<a class="parentMenu" href="?menu=<?php echo $row['name'] ?>"><?php echo $row['name'] ?></a>	
						
						<?php
						$Qitem= "SELECT * from item where category_id = '$row[id]'";
						$Citem = $db->sql_total($Qitem);
						$Ritem = $db->sql_fetch($Qitem);
						if($Citem <> 0){
							echo "<ul>";
							foreach($Ritem as $i){
								?>
									<li><a class="tahoma11G" href="product_detail.php?id=<?php echo $i['id'] ?>"><?php echo strtoupper($i['name']); ?></a></li>
								<?php
							}
							echo "</ul>";
							echo "</li>";
						
						}else{
							echo "</li>";
						}
					}
				?>
			</ul>
		</td>
	</tr>
</table>